import 'package:json_annotation/json_annotation.dart';
import 'shop_category.dart';
import 'store.dart';

part 'coupon.g.dart';

@JsonSerializable()
class Coupon extends Object {
  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'remark')
  String remark;

  @JsonKey(name: 'start_at')
  String startAt;

  @JsonKey(name: 'end_at')
  String endAt;

  @JsonKey(name: 'money')
  String money;

  @JsonKey(name: 'full_money')
  String fullMoney;

  @JsonKey(name: 'state')
  String state;

  @JsonKey(name: 'shop_category')
  ShopCategory shopCategory;

  @JsonKey(name: 'shop')
  Store shop;

  Coupon(
    this.id,
    this.name,
    this.remark,
    this.startAt,
    this.endAt,
    this.money,
    this.fullMoney,
    this.state,
    this.shopCategory,
    this.shop,
  );

  factory Coupon.fromJson(Map<String, dynamic> srcJson) =>
      _$CouponFromJson(srcJson);
}
